package com.tianqu.tms.entity;

import com.tianqu.tms.core.exception.TmsDaoException;
import com.tianqu.tms.dao.TmsDao;
import com.tianqu.tms.dao.TmsMessageHistoryDaoImp;
import com.tianqu.tms.dto.MessageHistoryDto;

public class TmsMessageEntity {
	public static int PROTOCOL_PROTOBUF = 1;
	public static int PROTOCOL_JSON = 2;
	//
	public static int TYPE_TMS = 1;
	public static int TYPE_APP = 2;
	public static int TYPE_TMS_BATCH = 3;
	public static int TYPE_APP_BATCH = 4;
	//
	public static int RESULT_OK = 1;
	public static int RESULT_NG = 2;
	//
	public static int ACTION_SEND = 1;
	public static int ACTION_RECEIVE = 2;
	
	private static TmsMessageEntity INSTANCE = new TmsMessageEntity();
	
	public static TmsMessageEntity getInstance(){ return INSTANCE;}
	
	
	private TmsMessageEntity(){}
	
	public void insert(MessageHistoryDto dto) throws TmsDaoException {
		TmsMessageHistoryDaoImp mDao = (TmsMessageHistoryDaoImp) TmsDao.getInstance(TmsDao.TMS_MESSAGE_HISTORY);
		mDao.insert(dto);
	}
}
